From 539f93945cad06fd90784716be1dc8d2624b6f66 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 6 Apr 2018 18:12:37 +0100 Subject: [PATCH] docs/Makefile: Introduce GENERATE_PANDOC_RULE_RAW We are going to want to format SUPPORT.md which does not match the filename patterns in docs/. So provide a way to make an ad-hoc rule using pandoc with the standard options. No functional change in this patch. Signed-off-by: Ian Jackson Release-acked-by: Juergen Gross Acked-by: Lars Kurth --- docs/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 6743fa3744..d82463fdb2 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -237,17 +237,18 @@ txt/%.txt: %.markdown $(INSTALL_DATA) $< $@ # Metarule for generating pandoc rules. -define GENERATE_PANDOC_RULE -# $(1) is the target documentation format. $(2) is the source format. - -$(1)/%.$(1): %.$(2) +define GENERATE_PANDOC_RULE_RAW +$(1): $(2) ifneq ($(PANDOC),) @$(INSTALL_DIR) $$(@D) $(PANDOC) --number-sections --toc --standalone $$< --output $$@ else @echo "pandoc not installed; skipping $$@" endif - +endef +define GENERATE_PANDOC_RULE +# $(1) is the target documentation format. $(2) is the source format. +$(call GENERATE_PANDOC_RULE_RAW,$(1)/%.$(1),%.$(2)) endef $(eval $(call GENERATE_PANDOC_RULE,pdf,pandoc)) # pdf/%.pdf: %.pandoc $(eval $(call GENERATE_PANDOC_RULE,txt,pandoc)) # txt/%.txt: %.pandoc -- 2.30.2